package com.aspose.cells;

class zawx extends zawv {
   private boolean l;

   public zawx(zahn var1, zahn var2, zagl var3, zaay var4) {
      super(var1, var2, var3, var4);
      this.l = this.a.m() || this.a.n();
   }

   zawx(zahn var1, zahn var2, zawx var3, zaay var4) {
      super(var1, var2, (zagl)var3.c.a(var4), var4);
      this.l = var3.l;
      this.e = var3.e;
   }

   public zahn b(zaay var1) {
      return new zawx(this.a.b(var1), this.b.b(var1), this, var1);
   }

   public boolean b(int var1, int var2) {
      if (this.j != null) {
         if (this.f) {
            if (var1 == this.a.i() && var2 == this.a.j()) {
               return true;
            }
         } else if (this.g && var1 == this.b.i() && var2 == this.b.j()) {
            return true;
         }

         this.j = null;
      }

      this.h = this.a.b(var1, var2);
      this.i = this.b.b(var1, var2);
      return this.C();
   }

   public boolean a(int var1) {
      if (this.j != null) {
         if (this.f) {
            if (var1 == this.a.k()) {
               return true;
            }
         } else if (this.g && var1 == this.b.k()) {
            return true;
         }

         this.j = null;
      }

      this.h = this.a.a(var1);
      this.i = this.b.a(var1);
      return this.C();
   }

   private boolean C() {
      if (this.h) {
         if (this.i) {
            int var1;
            if (this.l) {
               var1 = this.a.k() - this.b.k();
            } else {
               var1 = this.a.i() - this.b.i();
               if (var1 == 0) {
                  var1 = this.a.j() - this.b.j();
               }
            }

            if (var1 > 0) {
               this.f = false;
               this.g = true;
            } else {
               this.f = true;
               this.g = var1 == 0;
            }
         } else {
            this.f = true;
            this.g = false;
         }

         return true;
      } else if (this.i) {
         this.f = false;
         this.g = true;
         return true;
      } else {
         return false;
      }
   }

   public boolean g() {
      if (this.k) {
         this.k = false;
         this.j = null;
         if (this.f) {
            if (this.i) {
               if (this.l) {
                  this.h = this.a.a(this.b.k());
               } else {
                  this.h = this.a.b(this.b.i(), this.b.j());
               }

               return this.C();
            }
         } else if (this.h) {
            if (this.l) {
               this.i = this.b.a(this.a.k());
            } else {
               this.i = this.b.b(this.a.i(), this.a.j());
            }

            return this.C();
         }

         return false;
      } else {
         this.j = null;
         if (this.f) {
            this.h = this.a.g();
            if (this.g) {
               this.i = this.b.g();
            }

            return this.C();
         } else if (this.g) {
            this.i = this.b.g();
            return this.C();
         } else {
            return false;
         }
      }
   }

   public zahn b(int var1) {
      if (this.a.m()) {
         return this;
      } else {
         return (zahn)(this.a.n() ? new zaya(this.a(var1, 0)) : new zawx(this.a.b(var1), this.b.b(var1), this, (zaay)null));
      }
   }

   public zahn c(int var1) {
      if (this.a.n()) {
         return this;
      } else {
         return (zahn)(this.a.m() ? new zaya(this.a(0, var1)) : new zawx(this.a.c(var1), this.b.c(var1), this, (zaay)null));
      }
   }

   public zahn c(zaay var1) {
      Object var2;
      if (this.l) {
         var2 = new zbvk(this, this.e, Math.min(this.a.v(), this.b.v()), Math.max(this.a.w(), this.b.w()), this.a.m() ? this.a.d() : this.a.c(), this.a.n());
      } else {
         var2 = new zbvm(this, this.e, Math.min(this.a.r(), this.b.r()), Math.min(this.a.t(), this.b.t()), Math.max(this.a.s(), this.b.s()), Math.max(this.a.u(), this.b.u()), this.a.c(), this.a.d());
      }

      return new zawy(new zawx(this.a, this.b, this, var1), (zaik)var2, var1);
   }

   public int i() {
      return this.f ? this.a.i() : this.b.i();
   }

   public int j() {
      return this.f ? this.a.j() : this.b.j();
   }

   public int k() {
      return this.f ? this.a.k() : this.b.k();
   }

   public boolean m() {
      return this.a.m();
   }

   public boolean n() {
      return this.a.n();
   }

   public int c() {
      return this.a.c();
   }

   public int d() {
      return this.a.d();
   }

   public int e() {
      return this.a.e();
   }

   public boolean q() {
      return this.a.q() && this.b.q();
   }

   public int r() {
      return Math.min(this.a.r(), this.b.r());
   }

   public int s() {
      return Math.max(this.a.s(), this.b.s());
   }

   public int t() {
      return Math.min(this.a.t(), this.b.t());
   }

   public int u() {
      return Math.max(this.a.u(), this.b.u());
   }

   public int v() {
      return Math.min(this.a.v(), this.b.v());
   }

   public int w() {
      return Math.max(this.a.w(), this.b.w());
   }
}
